<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!--引用CW标签  -->
<%@ taglib uri="/WEB-INF/taglib/cw" prefix="CW" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
    <base href="<%=basePath%>">
    <title></title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<link href="<%=basePath%>css/en/edit.css" rel="stylesheet" type="text/css">
	<link href="<%=basePath%>css/en/list.css" rel="stylesheet" type="text/css">
	<script type="text/javascript" src="<%=basePath%>js/commons/common_edit.js"></script>
</head>
<body>
<form action="user/updateHomeUser.action" name="updateUserForm" id="updateUserForm" method="post">
	<input type="hidden" name="userInfo.UserId" id="UserId"   value="<s:property value="userInfo.UserId" />"/>
	<s:hidden name="actionResult" id="actionResult" ></s:hidden>
	<!-- 页面头 -->
	<div class="pageheader">
		<!-- 操作按钮 -->
		<div class="pageheadercontent">
			<div class="toolbar">
				<div class="toolbarright">
					<input class="okbtn" name="_submit" type="button" value="OK" onclick="__submit()">
				</div>
			</div>
		</div>
	</div>
	<!-- 编辑 -->
    <input name="fileFileName" id="fileFileName" type="hidden" />
	<div class="writetblbox" style="width: 750px">
		<table class="writetbl" style="width:100%">
			<tr>
				<th style="width: 25%">用户名：</th>
				<td>
					<input name="userInfo.UserName" readonly="readonly" type="text" value="<s:property value="userInfo.UserName" />">
				</td>
			</tr>
			<tr>
				<th>用户姓名：</th>
				<td>
					<input name="userInfo.FullName" type="text" value="<s:property value="userInfo.FullName" />">
				</td>
			</tr>
			<tr>
				<th>性别：</th>
				<td>
					<select name="userInfo.Sex"> 
						<option value="0">--请选择--</option>
						<option value="1" <s:if test="%{userInfo.Sex == 1}">selected</s:if>>男</option>
						<option value="2" <s:if test="%{userInfo.Sex == 2}">selected</s:if>>女</option>
					</select>
				</td>
			</tr>
			<tr>
				<th>邮箱：</th>
				<td>
					<input name="userInfo.EmailAddress" type="text" value="<s:property value="userInfo.EmailAddress" />">
				</td>
			</tr>
		</table>
	</div>
</form>
<span class="_height"></span>
<script type="text/javascript">
	$(document).ready(function() {
		$('#updateUserForm').validate(
		{
			rules : {
		        "userInfo.FullName" : {
					required : true,
					maxlength : 32
				},
		        "userInfo.EmailAddress" : {
					email : true,
					rangelength:[3,32]
				}
			}
		});
		var success=$("#actionResult").val();
		if(success=='success'){
			parent.location.reload();
			window.close();
		}
	});
	function __submit(){
		if($("#updateUserForm").valid()){
			document.updateUserForm.action="<%=basePath%>user/updateHomeUser.action";
			document.updateUserForm.submit();
		}
	}
</script>
</body>
</html>
